import { createApp } from "vue";
import App from "./App.vue";
import pinia from './store/index';
import mitt from 'mitt';
// 1. 导入路由对象
import router from './router';

import ElementPlus from 'element-plus'
import { registerIcons } from './utils/common'
import { directives } from './utils/directives'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/display.css'
import 'font-awesome/css/font-awesome.min.css'
import './styles/index.scss'
import { loadLang } from './lang/index'

import VxeUI from 'vxe-pc-ui'
import 'vxe-pc-ui/lib/style.css'
import VxeUITable from 'vxe-table'
import 'vxe-table/lib/style.css'

//import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'
//import '@vxe-ui/plugin-render-element/dist/style.css'
//VxeUI.use(VxeUIPluginRenderElement)
async function start() {
    const app = createApp(App);

    app.use(pinia);
    await loadLang(app);
    app.use(VxeUI);
    app.use(VxeUITable);
    app.use(ElementPlus);
    
    app.use(router);
    directives(app);
    registerIcons(app);
    app.mount("#app");
    app.config.globalProperties.eventBus = mitt()
}
start()
